<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/7/5 0005
 * Time: 11:11
 * $this yii\web\view
 */
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
//视图数据绑定
$this->title = '登录';
?>
<div class="site-box">
    <h1>test</h1>

    <div class="entry-form">
        <?php
            $form = ActiveForm::begin([
                'id'=>'login-form',
                'layout'=>'horizontal',
                'fieldConfig' => [
                    'template'=>"{label}\n<div class=\"col-lg-3 col-md-3 col-xs-3 col-sm-3\">{input}</div>\n<div class=\"col-lg-8 col-md-8 col-xs-8 col-sm-8\">{error}</div>",
                    'labelOptions' => ['class'=>'col-lg-1 col-md-1 col-xs-1 col-sm-1 control-label']
                ]
            ]);
        ?>
        <?= $form->field($model, 'username')->textInput(['autofocus' => true]) ?>

        <?= $form->field($model, 'pwd')->passwordInput() ?>

        <?= $form->field($model,'rememberMe')->checkbox([
            'template' => "<div class='col-lg-offset-1 col-sm-offset-1 col-xs-offset-1 col-md-offset-1'>{input}{label}</div><div class='col-lg-8 col-md-8 col-xs-8 col-sm-8'>{error}</div>"
        ]) ?>

        <div class="form-group">
            <div class="col-lg-offset-1 col-md-offset-3 col-xs-offset-4 col-sm-offset-4 col-md-9 col-xs-8 col-sm-8 col-lg-11">
                <?= Html::submitButton('登录', ['class' => 'btn btn-primary', 'name' => 'login-button']) ?>
            </div>
        </div>

        <?php ActiveForm::end(); ?>

    </div>

</div>
